From eb837a4888ab4e0fa91931f49a927e7af0254367 Mon Sep 17 00:00:00 2001
From: Jeremy Rand <jeremyrand@airmail.cc>
Date: Tue, 4 Aug 2020 02:42:00 +0000
Subject: [PATCH 1/6] Launch Namecoin on Linux

---
 src/components/tl-process.js | 60 ++++++++++++++++++++++++++++++++++--
 src/modules/tl-util.jsm      |  8 +++++
 2 files changed, 66 insertions(+), 2 deletions(-)

diff --git a/src/components/tl-process.js b/src/components/tl-process.js
index e9d7cde..510cbaf 100644
--- a/src/components/tl-process.js
+++ b/src/components/tl-process.js
@@ -393,11 +393,30 @@ TorProcessService.prototype =
       var torrcFile = TorLauncherUtil.getTorFile("torrc", true);
       var torrcDefaultsFile =
                     TorLauncherUtil.getTorFile("torrc-defaults", false);
+      var electrumNMCFile = null;
+      var stemNSFile = null;
       var hashedPassword = this.mProtocolSvc.TorGetPassword(true);
       var controlIPCFile = this.mProtocolSvc.TorGetControlIPCFile();
       var controlPort = this.mProtocolSvc.TorGetControlPort();
       var socksPortInfo = this.mProtocolSvc.TorGetSOCKSPortInfo();
 
+      let env = Cc["@mozilla.org/process/environment;1"]
+                  .getService(Ci.nsIEnvironment);
+
+      var enableNamecoin = false;
+      if (env.exists("TOR_ENABLE_NAMECOIN"))
+        enableNamecoin = env.get("TOR_ENABLE_NAMECOIN") == "1";
+
+      var verboseNamecoin = false;
+      if (enableNamecoin)
+      {
+        if (env.exists("TOR_VERBOSE_NAMECOIN"))
+          verboseNamecoin = env.get("TOR_VERBOSE_NAMECOIN") == "1";
+
+        electrumNMCFile = TorLauncherUtil.getTorFile("electrum-nmc", false);
+        stemNSFile = TorLauncherUtil.getTorFile("stemns", false);
+      }
+
       var detailsKey;
       if (!exeFile)
         detailsKey = "tor_missing";
@@ -407,11 +426,16 @@ TorProcessService.prototype =
         detailsKey = "datadir_missing";
       else if (!onionAuthDir)
         detailsKey = "onionauthdir_missing";
+      else if (!electrumNMCFile && enableNamecoin)
+        detailsKey = "electrum_nmc_missing";
+      else if (!stemNSFile && enableNamecoin)
+        detailsKey = "stemns_missing";
       else if (!hashedPassword)
         detailsKey = "password_hash_missing";
 
       if (detailsKey)
       {
+        // TODO: add strings for Electrum-NMC and StemNS
         var details = TorLauncherUtil.getLocalizedString(detailsKey);
         var key = "unable_to_start_tor";
         var err = TorLauncherUtil.getFormattedLocalizedString(key,
@@ -517,11 +541,15 @@ TorProcessService.prototype =
         args.push("1");
       }
 
+      if (enableNamecoin)
+      {
+        args.push("__LeaveStreamsUnattached");
+        args.push("1");
+      }
+
       // Set an environment variable that points to the Tor data directory.
       // This is used by meek-client-torbrowser to find the location for
       // the meek browser profile.
-      let env = Cc["@mozilla.org/process/environment;1"]
-                  .getService(Ci.nsIEnvironment);
       env.set("TOR_BROWSER_TOR_DATA_DIR", dataDir.path);
 
       // On Windows, prepend the Tor program directory to PATH.  This is
@@ -547,6 +575,34 @@ TorProcessService.prototype =
       p.runwAsync(args, args.length, this, false);
       this.mTorProcess = p;
       this.mTorProcessStartTime = Date.now();
+
+      if (enableNamecoin)
+      {
+        args = [];
+        args.push("daemon");
+        if (verboseNamecoin)
+          args.push("-v");
+        args.push("--dir");
+        args.push("TorBrowser/Data/Electrum-NMC/");
+
+        p = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
+        p.init(electrumNMCFile);
+
+        TorLauncherLogger.log(2, "Starting " + electrumNMCFile.path);
+        for (var i = 0; i < args.length; ++i)
+          TorLauncherLogger.log(2, "  " + args[i]);
+
+        p.runwAsync(args, args.length, this, false);
+
+        args = [];
+
+        p = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
+        p.init(stemNSFile);
+
+        TorLauncherLogger.log(2, "Starting " + stemNSFile.path);
+
+        p.runwAsync(args, args.length, this, false);
+      }
     }
     catch (e)
     {
diff --git a/src/modules/tl-util.jsm b/src/modules/tl-util.jsm
index b721372..ad56752 100644
--- a/src/modules/tl-util.jsm
+++ b/src/modules/tl-util.jsm
@@ -613,6 +613,10 @@ let TorLauncherUtil =  // Public
             path = "Tor/PluggableTransports";
           else if (isIPC)
             path = "Tor/" + ipcFileName;
+          else if ("electrum-nmc" == aTorFileType)
+            path = "TorBrowser/Electrum-NMC/run_electrum_nmc";
+          else if ("stemns" == aTorFileType)
+            path = "TorBrowser/StemNS/poc.py";
         }
       }
       else if (this.isWindows)
@@ -652,6 +656,10 @@ let TorLauncherUtil =  // Public
           path = "Data/Browser";
         else if (isIPC)
           path = "Data/Tor/" + ipcFileName;
+        else if ("electrum-nmc" == aTorFileType)
+          path = "Electrum-NMC/run_electrum_nmc";
+        else if ("stemns" == aTorFileType)
+          path = "StemNS/poc.py";
       }
 
       if (!path && !useAppDir)
-- 
2.20.1


From b65d5e8b5256d2f6ae41f248dc95048d43336c43 Mon Sep 17 00:00:00 2001
From: Jeremy Rand <jeremyrand@airmail.cc>
Date: Wed, 19 Aug 2020 05:19:19 +0000
Subject: [PATCH 2/6] Launch Namecoin on Windows

---
 src/components/tl-process.js | 17 +++++++++++
 src/modules/tl-util.jsm      | 56 ++++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+)

diff --git a/src/components/tl-process.js b/src/components/tl-process.js
index 510cbaf..75d8b4e 100644
--- a/src/components/tl-process.js
+++ b/src/components/tl-process.js
@@ -395,6 +395,7 @@ TorProcessService.prototype =
                     TorLauncherUtil.getTorFile("torrc-defaults", false);
       var electrumNMCFile = null;
       var stemNSFile = null;
+      var pythonFile = null;
       var hashedPassword = this.mProtocolSvc.TorGetPassword(true);
       var controlIPCFile = this.mProtocolSvc.TorGetControlIPCFile();
       var controlPort = this.mProtocolSvc.TorGetControlPort();
@@ -415,6 +416,8 @@ TorProcessService.prototype =
 
         electrumNMCFile = TorLauncherUtil.getTorFile("electrum-nmc", false);
         stemNSFile = TorLauncherUtil.getTorFile("stemns", false);
+        if (TorLauncherUtil.isWindows)
+          pythonFile = TorLauncherUtil.getTorFile("python", false);
       }
 
       var detailsKey;
@@ -430,6 +433,8 @@ TorProcessService.prototype =
         detailsKey = "electrum_nmc_missing";
       else if (!stemNSFile && enableNamecoin)
         detailsKey = "stemns_missing";
+      else if (!pythonFile && enableNamecoin && TorLauncherUtil.isWindows)
+        detailsKey = "python_missing";
       else if (!hashedPassword)
         detailsKey = "password_hash_missing";
 
@@ -579,6 +584,11 @@ TorProcessService.prototype =
       if (enableNamecoin)
       {
         args = [];
+        if (TorLauncherUtil.isWindows)
+        {
+          args.push(electrumNMCFile.path);
+          electrumNMCFile = pythonFile;
+        }
         args.push("daemon");
         if (verboseNamecoin)
           args.push("-v");
@@ -595,11 +605,18 @@ TorProcessService.prototype =
         p.runwAsync(args, args.length, this, false);
 
         args = [];
+        if (TorLauncherUtil.isWindows)
+        {
+          args.push(stemNSFile.path);
+          stemNSFile = pythonFile;
+        }
 
         p = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
         p.init(stemNSFile);
 
         TorLauncherLogger.log(2, "Starting " + stemNSFile.path);
+        for (var i = 0; i < args.length; ++i)
+          TorLauncherLogger.log(2, "  " + args[i]);
 
         p.runwAsync(args, args.length, this, false);
       }
diff --git a/src/modules/tl-util.jsm b/src/modules/tl-util.jsm
index ad56752..f2971e8 100644
--- a/src/modules/tl-util.jsm
+++ b/src/modules/tl-util.jsm
@@ -554,6 +554,12 @@ let TorLauncherUtil =  // Public
 
     if (!path && !torFile)
     {
+      let env = Cc["@mozilla.org/process/environment;1"]
+                  .getService(Ci.nsIEnvironment);
+      var verboseNamecoin = false;
+      if (env.exists("TOR_VERBOSE_NAMECOIN"))
+        verboseNamecoin = env.get("TOR_VERBOSE_NAMECOIN") == "1";
+
       // No preference and no pre-determined IPC path: use a default path.
       isRelativePath = true;
       if (TLUtilInternal._isUserDataOutsideOfAppDir)
@@ -575,6 +581,14 @@ let TorLauncherUtil =  // Public
             path = "Tor\\onion-auth";
           else if ("pt-profiles-dir" == aTorFileType)
             path = "Tor\\PluggableTransports";
+          else if ("electrum-nmc" == aTorFileType)
+            path = "TorBrowser\\Electrum-NMC\\run_electrum_nmc";
+          else if ("stemns" == aTorFileType)
+            path = "TorBrowser\\StemNS\\poc.py";
+          else if ("python" == aTorFileType && verboseNamecoin)
+            path = "python.exe";
+          else if ("python" == aTorFileType)
+            path = "pythonw.exe";
         }
         else if (this.isMac)
         {
@@ -636,6 +650,14 @@ let TorLauncherUtil =  // Public
           path = "Data\\Tor\\onion-auth";
         else if ("pt-profiles-dir" == aTorFileType)
           path = "Data\\Browser";
+        else if ("electrum-nmc" == aTorFileType)
+          path = "Electrum-NMC\\run_electrum_nmc";
+        else if ("stemns" == aTorFileType)
+          path = "StemNS\\poc.py";
+        else if ("python" == aTorFileType && verboseNamecoin)
+          path = "python.exe";
+        else if ("python" == aTorFileType)
+          path = "pythonw.exe";
         }
       else // Linux, Mac OS and others.
       {
@@ -668,6 +690,40 @@ let TorLauncherUtil =  // Public
 
     try
     {
+      // Python searching is only a thing on Windows
+      if ("python" == aTorFileType)
+      {
+        const kEnvPath = "PATH";
+        var env = Cc["@mozilla.org/process/environment;1"]
+                    .getService(Ci.nsIEnvironment);
+
+        if (!env.exists(kEnvPath))
+          return null;
+        var searchPaths = env.get(kEnvPath).split(";");
+
+        for (var i = 0; i < searchPaths.length; ++i)
+        {
+          torFile = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);
+          try {
+            torFile.initWithPath(searchPaths[i]);
+          }
+          catch (e)
+          {
+            // Passing the empty string to initWithPath causes an error.
+            // searchPaths will end with an empty string if the PATH contains a
+            // trailing semicolon.  Other invalid/weird paths (if present in
+            // PATH) might also cause an error, so we catch them all here in an
+            // attempt to be tolerant.
+            continue;
+          }
+          torFile.append(path);
+          if (torFile.exists())
+            return torFile;
+        }
+
+        return null;
+      }
+
       if (useAppDir)
       {
         torFile = TLUtilInternal._appDir.clone();
-- 
2.20.1


From b833fa5c481fd5568a5885a0b96bc81737006d3a Mon Sep 17 00:00:00 2001
From: Jeremy Rand <jeremyrand@airmail.cc>
Date: Thu, 3 Sep 2020 07:30:34 +0000
Subject: [PATCH 3/6] Launch Namecoin on macOS

---
 src/modules/tl-util.jsm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/modules/tl-util.jsm b/src/modules/tl-util.jsm
index f2971e8..7f2ddd0 100644
--- a/src/modules/tl-util.jsm
+++ b/src/modules/tl-util.jsm
@@ -608,6 +608,10 @@ let TorLauncherUtil =  // Public
             path = "Tor/PluggableTransports";
           else if (isIPC)
             path = "Tor/" + ipcFileName;
+          else if ("electrum-nmc" == aTorFileType)
+            path = "Contents/MacOS/Electrum-NMC/run_electrum_nmc";
+          else if ("stemns" == aTorFileType)
+            path = "Contents/MacOS/StemNS/poc.py";
         }
         else // Linux and others.
         {
-- 
2.20.1


From b0857d34daa775991ea63c6bcd424000ef2d887a Mon Sep 17 00:00:00 2001
From: Jeremy Rand <jeremyrand@airmail.cc>
Date: Thu, 10 Sep 2020 08:00:58 +0000
Subject: [PATCH 4/6] Detect presence of Electrum-NMC data dir

---
 src/components/tl-process.js |  8 +++++++-
 src/modules/tl-util.jsm      | 24 +++++++++++++++++++++++-
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/src/components/tl-process.js b/src/components/tl-process.js
index 75d8b4e..006a98a 100644
--- a/src/components/tl-process.js
+++ b/src/components/tl-process.js
@@ -415,6 +415,8 @@ TorProcessService.prototype =
           verboseNamecoin = env.get("TOR_VERBOSE_NAMECOIN") == "1";
 
         electrumNMCFile = TorLauncherUtil.getTorFile("electrum-nmc", false);
+        electrumNMCDataDir = TorLauncherUtil.getTorFile("electrum-nmc-data-dir", false);
+        electrumNMCConfigFile = TorLauncherUtil.getTorFile("electrum-nmc-config", false);
         stemNSFile = TorLauncherUtil.getTorFile("stemns", false);
         if (TorLauncherUtil.isWindows)
           pythonFile = TorLauncherUtil.getTorFile("python", false);
@@ -431,6 +433,10 @@ TorProcessService.prototype =
         detailsKey = "onionauthdir_missing";
       else if (!electrumNMCFile && enableNamecoin)
         detailsKey = "electrum_nmc_missing";
+      else if (!electrumNMCDataDir && enableNamecoin)
+        detailsKey = "electrum_nmc_data_dir_missing";
+      else if (!electrumNMCConfigFile && enableNamecoin)
+        detailsKey = "electrum_nmc_config_missing";
       else if (!stemNSFile && enableNamecoin)
         detailsKey = "stemns_missing";
       else if (!pythonFile && enableNamecoin && TorLauncherUtil.isWindows)
@@ -593,7 +599,7 @@ TorProcessService.prototype =
         if (verboseNamecoin)
           args.push("-v");
         args.push("--dir");
-        args.push("TorBrowser/Data/Electrum-NMC/");
+        args.push(electrumNMCDataDir);
 
         p = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
         p.init(electrumNMCFile);
diff --git a/src/modules/tl-util.jsm b/src/modules/tl-util.jsm
index 7f2ddd0..afce181 100644
--- a/src/modules/tl-util.jsm
+++ b/src/modules/tl-util.jsm
@@ -469,7 +469,9 @@ let TorLauncherUtil =  // Public
     let isRelativePath = false;
     let isUserData = (aTorFileType != "tor") &&
                      (aTorFileType != "pt-startup-dir") &&
-                     (aTorFileType != "torrc-defaults");
+                     (aTorFileType != "torrc-defaults") &&
+                     (aTorFileType != "electrum-nmc") &&
+                     (aTorFileType != "stemns");
     let isControlIPC = ("control_ipc" == aTorFileType);
     let isSOCKSIPC = ("socks_ipc" == aTorFileType);
     let isIPC = isControlIPC || isSOCKSIPC;
@@ -583,6 +585,10 @@ let TorLauncherUtil =  // Public
             path = "Tor\\PluggableTransports";
           else if ("electrum-nmc" == aTorFileType)
             path = "TorBrowser\\Electrum-NMC\\run_electrum_nmc";
+          else if ("electrum-nmc-data-dir" == aTorFileType)
+            path = "Electrum-NMC";
+          else if ("electrum-nmc-config" == aTorFileType)
+            path = "Electrum-NMC\\config";
           else if ("stemns" == aTorFileType)
             path = "TorBrowser\\StemNS\\poc.py";
           else if ("python" == aTorFileType && verboseNamecoin)
@@ -610,6 +616,10 @@ let TorLauncherUtil =  // Public
             path = "Tor/" + ipcFileName;
           else if ("electrum-nmc" == aTorFileType)
             path = "Contents/MacOS/Electrum-NMC/run_electrum_nmc";
+          else if ("electrum-nmc-data-dir" == aTorFileType)
+            path = "Electrum-NMC";
+          else if ("electrum-nmc-config" == aTorFileType)
+            path = "Electrum-NMC/config";
           else if ("stemns" == aTorFileType)
             path = "Contents/MacOS/StemNS/poc.py";
         }
@@ -633,6 +643,10 @@ let TorLauncherUtil =  // Public
             path = "Tor/" + ipcFileName;
           else if ("electrum-nmc" == aTorFileType)
             path = "TorBrowser/Electrum-NMC/run_electrum_nmc";
+          else if ("electrum-nmc-data-dir" == aTorFileType)
+            path = "Electrum-NMC";
+          else if ("electrum-nmc-config" == aTorFileType)
+            path = "Electrum-NMC/config";
           else if ("stemns" == aTorFileType)
             path = "TorBrowser/StemNS/poc.py";
         }
@@ -656,6 +670,10 @@ let TorLauncherUtil =  // Public
           path = "Data\\Browser";
         else if ("electrum-nmc" == aTorFileType)
           path = "Electrum-NMC\\run_electrum_nmc";
+        else if ("electrum-nmc-data-dir" == aTorFileType)
+          path = "Data\\Electrum-NMC";
+        else if ("electrum-nmc-config" == aTorFileType)
+          path = "Data\\Electrum-NMC\\config";
         else if ("stemns" == aTorFileType)
           path = "StemNS\\poc.py";
         else if ("python" == aTorFileType && verboseNamecoin)
@@ -684,6 +702,10 @@ let TorLauncherUtil =  // Public
           path = "Data/Tor/" + ipcFileName;
         else if ("electrum-nmc" == aTorFileType)
           path = "Electrum-NMC/run_electrum_nmc";
+        else if ("electrum-nmc-data-dir" == aTorFileType)
+          path = "Data/Electrum-NMC";
+        else if ("electrum-nmc-config" == aTorFileType)
+          path = "Data/Electrum-NMC/config";
         else if ("stemns" == aTorFileType)
           path = "StemNS/poc.py";
       }
-- 
2.20.1


From a1e098ff9234c1c277f9b2f1b3a0030212b4629f Mon Sep 17 00:00:00 2001
From: Jeremy Rand <jeremyrand@airmail.cc>
Date: Sun, 13 Sep 2020 08:07:07 +0000
Subject: [PATCH 5/6] (FIXUP) macOS fixes

---
 src/components/tl-process.js | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/components/tl-process.js b/src/components/tl-process.js
index 006a98a..f6ba43c 100644
--- a/src/components/tl-process.js
+++ b/src/components/tl-process.js
@@ -394,6 +394,8 @@ TorProcessService.prototype =
       var torrcDefaultsFile =
                     TorLauncherUtil.getTorFile("torrc-defaults", false);
       var electrumNMCFile = null;
+	  var electrumNMCDataDir = null;
+	  var electrumNMCConfigFile = null;
       var stemNSFile = null;
       var pythonFile = null;
       var hashedPassword = this.mProtocolSvc.TorGetPassword(true);
@@ -599,7 +601,16 @@ TorProcessService.prototype =
         if (verboseNamecoin)
           args.push("-v");
         args.push("--dir");
-        args.push(electrumNMCDataDir);
+        args.push(electrumNMCDataDir.path);
+        args.push("--pausenetwork");
+        args.push("--proxy");
+        args.push("socks5:127.0.0.1:9150::");
+        args.push("--rpcport");
+        args.push("8336");
+        args.push("--rpcuser");
+        args.push("user");
+        args.push("--rpcpassword");
+        args.push("password");
 
         p = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
         p.init(electrumNMCFile);
-- 
2.20.1


From a0d5095e4acf8755e730daf7e5ecaec13c7a526a Mon Sep 17 00:00:00 2001
From: Jeremy Rand <jeremyrand@airmail.cc>
Date: Sun, 13 Sep 2020 08:31:28 +0000
Subject: [PATCH 6/6] (FIXUP) More macOS fixes

---
 src/components/tl-process.js |  8 ++------
 src/modules/tl-util.jsm      | 13 ++-----------
 2 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/src/components/tl-process.js b/src/components/tl-process.js
index f6ba43c..86e1c59 100644
--- a/src/components/tl-process.js
+++ b/src/components/tl-process.js
@@ -394,8 +394,7 @@ TorProcessService.prototype =
       var torrcDefaultsFile =
                     TorLauncherUtil.getTorFile("torrc-defaults", false);
       var electrumNMCFile = null;
-	  var electrumNMCDataDir = null;
-	  var electrumNMCConfigFile = null;
+      var electrumNMCDataDir = null;
       var stemNSFile = null;
       var pythonFile = null;
       var hashedPassword = this.mProtocolSvc.TorGetPassword(true);
@@ -417,8 +416,7 @@ TorProcessService.prototype =
           verboseNamecoin = env.get("TOR_VERBOSE_NAMECOIN") == "1";
 
         electrumNMCFile = TorLauncherUtil.getTorFile("electrum-nmc", false);
-        electrumNMCDataDir = TorLauncherUtil.getTorFile("electrum-nmc-data-dir", false);
-        electrumNMCConfigFile = TorLauncherUtil.getTorFile("electrum-nmc-config", false);
+        electrumNMCDataDir = TorLauncherUtil.getTorFile("electrum-nmc-data-dir", true);
         stemNSFile = TorLauncherUtil.getTorFile("stemns", false);
         if (TorLauncherUtil.isWindows)
           pythonFile = TorLauncherUtil.getTorFile("python", false);
@@ -437,8 +435,6 @@ TorProcessService.prototype =
         detailsKey = "electrum_nmc_missing";
       else if (!electrumNMCDataDir && enableNamecoin)
         detailsKey = "electrum_nmc_data_dir_missing";
-      else if (!electrumNMCConfigFile && enableNamecoin)
-        detailsKey = "electrum_nmc_config_missing";
       else if (!stemNSFile && enableNamecoin)
         detailsKey = "stemns_missing";
       else if (!pythonFile && enableNamecoin && TorLauncherUtil.isWindows)
diff --git a/src/modules/tl-util.jsm b/src/modules/tl-util.jsm
index afce181..ac68569 100644
--- a/src/modules/tl-util.jsm
+++ b/src/modules/tl-util.jsm
@@ -587,8 +587,6 @@ let TorLauncherUtil =  // Public
             path = "TorBrowser\\Electrum-NMC\\run_electrum_nmc";
           else if ("electrum-nmc-data-dir" == aTorFileType)
             path = "Electrum-NMC";
-          else if ("electrum-nmc-config" == aTorFileType)
-            path = "Electrum-NMC\\config";
           else if ("stemns" == aTorFileType)
             path = "TorBrowser\\StemNS\\poc.py";
           else if ("python" == aTorFileType && verboseNamecoin)
@@ -618,8 +616,6 @@ let TorLauncherUtil =  // Public
             path = "Contents/MacOS/Electrum-NMC/run_electrum_nmc";
           else if ("electrum-nmc-data-dir" == aTorFileType)
             path = "Electrum-NMC";
-          else if ("electrum-nmc-config" == aTorFileType)
-            path = "Electrum-NMC/config";
           else if ("stemns" == aTorFileType)
             path = "Contents/MacOS/StemNS/poc.py";
         }
@@ -645,8 +641,6 @@ let TorLauncherUtil =  // Public
             path = "TorBrowser/Electrum-NMC/run_electrum_nmc";
           else if ("electrum-nmc-data-dir" == aTorFileType)
             path = "Electrum-NMC";
-          else if ("electrum-nmc-config" == aTorFileType)
-            path = "Electrum-NMC/config";
           else if ("stemns" == aTorFileType)
             path = "TorBrowser/StemNS/poc.py";
         }
@@ -672,8 +666,6 @@ let TorLauncherUtil =  // Public
           path = "Electrum-NMC\\run_electrum_nmc";
         else if ("electrum-nmc-data-dir" == aTorFileType)
           path = "Data\\Electrum-NMC";
-        else if ("electrum-nmc-config" == aTorFileType)
-          path = "Data\\Electrum-NMC\\config";
         else if ("stemns" == aTorFileType)
           path = "StemNS\\poc.py";
         else if ("python" == aTorFileType && verboseNamecoin)
@@ -704,8 +696,6 @@ let TorLauncherUtil =  // Public
           path = "Electrum-NMC/run_electrum_nmc";
         else if ("electrum-nmc-data-dir" == aTorFileType)
           path = "Data/Electrum-NMC";
-        else if ("electrum-nmc-config" == aTorFileType)
-          path = "Data/Electrum-NMC/config";
         else if ("stemns" == aTorFileType)
           path = "StemNS/poc.py";
       }
@@ -784,7 +774,8 @@ let TorLauncherUtil =  // Public
           {
             if (("tordatadir" == aTorFileType) ||
                 ("toronionauthdir" == aTorFileType) ||
-                ("pt-profiles-dir" == aTorFileType))
+                ("pt-profiles-dir" == aTorFileType) ||
+                ("electrum-nmc-data-dir" == aTorFileType))
             {
               torFile.create(torFile.DIRECTORY_TYPE, 0o700);
             }
-- 
2.20.1

